package toDo.app;

import toDo.app.models.TimeAuthority;
import toDo.app.models.ToDoListItem;
import android.os.Bundle;
import android.widget.TextView;

public class EditToDoActivity extends CreateToDoActivity {
	private TextView titleLabel;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		titleLabel = (TextView) findViewById(R.id.createToDoTitleLabel);
		titleLabel.setText(R.string.editToDoItem);
		createButton.setText(R.string.edit);
		
		ToDoListItem item = ToDoListItem.getItemFromIntent(getIntent());
		
		nameField.setText(item.itemName);
		descriptionField.setText(item.description);
		commentsField.setText(item.comments);
		categoryAutoField.setText(item.type);
		completedCheck.setChecked(item.completed != 0);
		locationField.setText(item.location);
		dateField.setText(TimeAuthority.timeStampToComponent(item.time));
		
		date = item.time;
		id = item._id;
	}
}
